package migrations

import (
	"github.com/goravel/framework/contracts/database/schema"
	"github.com/goravel/framework/facades"
)

type M20250303170401CreateBusgroupsTable struct {
}

// Signature The unique signature for the migration.
func (r *M20250303170401CreateBusgroupsTable) Signature() string {
	return "20250303170401_create_busgroups_table"
}

// Up Run the migrations.
func (r *M20250303170401CreateBusgroupsTable) Up() error {
	if !facades.Schema().HasTable("busgroups") {
		return facades.Schema().Create("busgroups", func(table schema.Blueprint) {
			table.ID()
			table.String("name")
			table.String("description")
			table.Timestamps()
		})
	}

	return nil
}

// Down Reverse the migrations.
func (r *M20250303170401CreateBusgroupsTable) Down() error {
	return facades.Schema().DropIfExists("busgroups")
}
